#include<stdio.h>
#include<assert.h>
//用于比较两个字符串的大小
//实际比较的是字符的ascii值
int my_strcmp(const char* arr1,const char* arr2)
{
    assert(arr1 && arr2);
    while(*arr1==*arr2)
    {
        if(*arr1=='\0')
        {
            return 0;
        }
        arr1++;
        arr2++;
    }
    if(*arr1>*arr2)
    {
        return 1;
    }
    else
    {
        return -1;
    }
}

int main()
{
    char arr1[]="zxcasd";
    char arr2[]="xxxxxxxxxxx";
    int ret=my_strcmp(arr1,arr2);
    if(ret==0)
    printf("arr1与arr2长度相等");
    else if(ret>0)
    printf("arr1>arr2"); 
    else
    printf("arr1<arr2");
    return 0;
}